package com.stylefeng.guns.wx.controller;

import com.stylefeng.guns.wx.service.WxContactService;
import com.stylefeng.guns.wx.transfer.WxContact;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@RequestMapping("wx/contact")
@Controller
public class WxContactController {

    @Autowired
    private WxContactService wxContactService;


    @RequestMapping(value = "list")
    @ResponseBody
    public Map<String, List<WxContact>> list(@RequestParam(value = "customerId", required = false) Integer customerId
            , @RequestParam(value = "name", required = false) String name
            , @RequestParam(value = "responsible", required = false) Integer responsible) {
        return wxContactService.list(customerId, name, responsible);
    }

}
